# -*- coding: utf-8 -*-
# @Time    : 2022/4/2 22:56
# @Author  : Mat
# @File    : main.py
# @Software: PyCharm

import xlrd
#打开excel
wb = xlrd.open_workbook('data.xlsx')
#按工作簿定位工作表
sh = wb.sheet_by_name('Sheet1')
nr=sh.nrows#有效数据行数
nc=sh.ncols#有效数据列数

for i in range(nr):
    p1 = "'"+str(sh.cell(i, 0).value)+"'"+","
    p2 = "'"+str(sh.cell(i, 1).value)+"'"+","
    p3 = str(sh.cell(i, 2).value)
    print("INSERT INTO sql_lab1_xxxxxxxx.sc VALUES ("+ p1,p2,p3,");")

